<template>
  <div class="pie-echart">
    <Echarts :options="options" />
  </div>
</template>

<script setup lang="ts">
import Echarts from '@/base-ui/echarts'
import { computed, defineProps } from 'vue'
const props = defineProps({
  pieData: {
    type: Array,
    required: true
  }
})

const options = computed(() => {
  return {
    tooltip: {
      trigger: 'item'
    },
    legend: {
      orient: 'horizontal',
      left: 'left'
    },
    series: [
      {
        name: '分类数据',
        type: 'pie',
        radius: '50%',
        data: props.pieData,
        emphasis: {
          itemStyle: {
            shadowBlur: 10,
            shadowOffsetX: 0,
            shadowColor: 'rgba(0, 0, 0, 0.5)'
          }
        }
      }
    ]
  }
})
</script>

<style scoped></style>
